﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Traceable.Infastructure.Migrations
{
    /// <inheritdoc />
    public partial class db2 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "aquaculture_Tables",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Batch_Id = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Variety = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    From = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Total_Days = table.Column<int>(type: "int", nullable: false),
                    Feed_Brand = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Keeper = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    End_Time = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Creater = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Updater = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_aquaculture_Tables", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "enterprise_Tables",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Batch_Id = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Traceable_Id = table.Column<int>(type: "int", nullable: false),
                    Farms = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Header = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    StockNumber = table.Column<int>(type: "int", nullable: true),
                    CompanyName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CompanyAdder = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Setup_Time = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CompanyDesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Permit = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Creater = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Updater = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_enterprise_Tables", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "image_Tables",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Batch_Id = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Traceable_Id = table.Column<int>(type: "int", nullable: false),
                    ImgType = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Imgurl = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Creater = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Updater = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_image_Tables", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "immunity_Tables",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Batch_Id = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Rearing_Day = table.Column<int>(type: "int", nullable: false),
                    Hygiene_Type = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Hygiene_Method = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Creater = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Updater = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_immunity_Tables", x => x.Id);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "aquaculture_Tables");

            migrationBuilder.DropTable(
                name: "enterprise_Tables");

            migrationBuilder.DropTable(
                name: "image_Tables");

            migrationBuilder.DropTable(
                name: "immunity_Tables");
        }
    }
}
